// components/Goods/shop-msg/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    data: {
      type: Object
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    onDetails(){
      let id = this.data.data.id
      wx.navigateTo({
        url: `/pages/my/near-shop/details?id=${id}`
      })
    },
    onContact() {
      let contact = this.data.data.contact
      wx.makePhoneCall({
        phoneNumber: contact // 仅为示例，并非真实的电话号码
      })
    },
    onToMap() {
      let data = this.data.data
      wx.openLocation({
        name: data.name,
        address: data.address,
        latitude: parseFloat(data.lat),
        longitude: parseFloat(data.lng),
        scale: 16
      })
    }
  }
})
